using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;


namespace OnlineAnadolu
{
    public partial class Kullanicilar : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Session["usertype"].ToString() == "")
            {
                Response.Redirect("HataSayfasi.aspx");
            }
            if (!IsPostBack)
            {
                SqlDataSource1.SelectCommand = "SELECT [firstname], [user_name] FROM [users]";
                GridView1.DataBind();

            }
            //ScriptManager1.RegisterPostBackControl(UpdatePanel1);
           // ScriptManager.RegisterStartupScript(this, this.GetType(), "key", true);
        }
        protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
        {
        }


        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
           
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            this.Response.Write("<script>javascript:window.close();</script>");
        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Session["us"] = GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text;

            ozelmesaj bg = new ozelmesaj();

           // ((TextBox)PreviousPage.FindControl("tb_receiver")).Text = Session["us"].ToString();
            

            Response.Redirect("ozelmesaj.aspx");
          

           
           // this.Response.Redirect("<script>javascript:window.close();</script>");

        }

        protected void tb_KullanciAd_TextChanged(object sender, EventArgs e)
        {
            SqlDataSource1.SelectCommand = "SELECT [firstname], [user_name] FROM [users]where user_name like  '%"+tb_KullanciAd.Text+"%'";
            GridView1.DataBind();
        }

        protected void Timer1_Tick(object sender, EventArgs e)
        {
            SqlDataSource1.SelectCommand = "SELECT [firstname], [user_name] FROM [users]where user_name like  '%" + tb_KullanciAd.Text + "%'";
            GridView1.DataBind();
            //tb_KullanciAd.Focus();
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
     
        }

        protected void Button1_Click1(object sender, EventArgs e)
        {

        }
    }
}
